package cn.ncu.wechat.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.ncu.wechat.model.MiniappConfig;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
* @author 12638
* @description 针对表【miniapp_config(小程序配置表)】的数据库操作Mapper
* @createDate 2025-02-06 21:13:47
* @Entity generator.domain.MiniappConfig
*/
@Mapper
public interface MiniappConfigMapper extends BaseMapper<MiniappConfig> {
    @Select("SELECT version_number AS version, release_date AS publishTime, publisher, remarks AS remark " +
            "FROM miniapp_config " +
            "ORDER BY version_id DESC")

    List<Map<String, Object>> selectPublishHistory();

    @Select("SELECT version_number AS version, release_date AS publishTime, publisher " +
            "FROM miniapp_config " +
            "ORDER BY version_id DESC " +
            "LIMIT 1")
    List<Map<String, Object>> selectLatestConfig();


}




